package com.jiegui.pay.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jiegui.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.jiegui.pay.mapper.InterfaceRequestMapper;
import com.jiegui.pay.domain.InterfaceRequest;
import com.jiegui.pay.service.InterfaceRequestService;

/**
 * 接口请求Service业务层处理
 * 
 * @author wuqicheng
 * @date 2021-12-10
 */
@Service
public class InterfaceRequestServiceImpl extends ServiceImpl<InterfaceRequestMapper, InterfaceRequest> implements InterfaceRequestService
{
    @Resource
    private InterfaceRequestMapper interfaceRequestMapper;

    /**
     * 查询接口请求
     * 
     * @param flowId 接口请求主键
     * @return 接口请求
     */
    @Override
    public InterfaceRequest selectInterfaceRequestByFlowId(String flowId)
    {
        return interfaceRequestMapper.selectById(flowId);
    }

    /**
     * 查询接口请求列表
     * 
     * @param interfaceRequest 接口请求
     * @return 接口请求
     */
    @Override
    public List<InterfaceRequest> selectInterfaceRequestList(InterfaceRequest interfaceRequest)
    {
        return interfaceRequestMapper.selectInterfaceRequestList(interfaceRequest);
    }

    /**
     * 新增接口请求
     * 
     * @param interfaceRequest 接口请求
     * @return 结果
     */
    @Override
    public int insertInterfaceRequest(InterfaceRequest interfaceRequest)
    {
        return interfaceRequestMapper.insert(interfaceRequest);
    }

    /**
     * 修改接口请求
     * 
     * @param interfaceRequest 接口请求
     * @return 结果
     */
    @Override
    public int updateInterfaceRequest(InterfaceRequest interfaceRequest)
    {

        return interfaceRequestMapper.updateById(interfaceRequest);
    }

    /**
     * 批量删除接口请求
     * 
     * @param flowIds 需要删除的接口请求主键
     * @return 结果
     */
    @Override
    public int deleteInterfaceRequestByFlowIds(String[] flowIds)
    {
        return interfaceRequestMapper.delete(new LambdaQueryWrapper<InterfaceRequest>().in(InterfaceRequest::getFlowId,flowIds));
    }

    /**
     * 删除接口请求信息
     * 
     * @param flowId 接口请求主键
     * @return 结果
     */
    @Override
    public int deleteInterfaceRequestByFlowId(String flowId)
    {
        return interfaceRequestMapper.deleteById(flowId);
    }
}
